import ajax from "../common/fui-request.js"
export const WorkOrderReviewApi = {
	/**
	 * 分页查询由我审核工单列表
	 */
	getList: (params) => ajax.post('/wechat/workOrderReview/pageList', {
		data: params
	}, ),
	/**
	 * 工单通过
	 */
	pass: (params) => ajax.post('/wechat/workOrderReview/pass', {
		data: params
	}),
	/**
	 *  工单驳回
	 */
	reject: (params) => ajax.post('/wechat/workOrderReview/reject', {
		data: params
	}),

}


/**
 *我的工单
 */
export const WorkOrderMyIndexApi = {
	/**
	 *获取列表数据
	 * @param {*} params 
	 * @param {*}  
	 */
	getlist: (params, ) => ajax.post('/wechat/workOrder/listWeChatOrder', {
		data: params
	}),
	/**
	 * 接单
	 */
	acceptOrder: (params) => ajax.request({
		url: '/wechat/workOrder/receive',
		method: 'PUT',
		data: params
	}),
	/**
	 * 终止
	 */
	termination: (params, ) => ajax.request({
		url: '/wechat/workOrder/termination',
		method: 'PUT',
		data: params
	}),
	/**
	 * 撤销审核
	 */
	revokeReview: (params, ) => ajax.request({
		url: '/wechat/workOrder/revokeReview',
		method: 'PUT',
		data: params
	}),
	/**
	 * 评价
	 */
	evaluate: (params) => ajax.post('/wechat/workOrder/evaluate', {
		data: params
	}, ),
	/**
	 * 退单
	 */
	chargeback: (params, ) => ajax.request({
		url: '/wechat/workOrder/reback',
		method: 'PUT',
		data: params
	}),
	/**
	 * 处理工单
	 */
	handleWorkOrder: (params, ) => ajax.request({
		url: '/wechat/workOrder/make',
		method: 'PUT',
		data: params
	}),
	/**
	 * 转单
	 */
	transferOrder: (params, ) => ajax.request({
		url: '/wechat/workOrder/redirect',
		method: 'PUT',
		data: params
	}),
	/**
	 * 协作工单
	 */
	collaborativeWorkOrder: (params, ) => ajax.request({
		url: '/wechat/workOrder/assist',
		method: 'PUT',
		data: params
	}),
	/**
	 * 升级工单
	 */
	upgrade: (params, ) => ajax.request({
		url: '/wechat/workOrder/upgrade',
		method: 'PUT',
		data: params
	}),
	/**
	 * 重启工单
	 */
	restart: (params, ) => ajax.request({
		url: '/wechat/workOrder/restart',
		method: 'PUT',
		data: params
	}),
	/**
	 * 开启工单
	 * @param {*} params 
	 * @param {*}  
	 */
	open: (params, ) => ajax.request({
		url: '/wechat/workOrder/open',
		method: 'PUT',
		data: params
	}),
	/**
	 * 完成工单
	 */
	complete: (params, ) => ajax.request({
		url: '/wechat/workOrder/complete',
		method: 'PUT',
		data: params
	}),
	/**
	 * 暂停
	 */
	pause: (params, ) => ajax.request({
		url: '/wechat/workOrder/suspend',
		method: 'PUT',
		data: params
	}),
	/**
	 * 催单
	 */
	reminder: (params) => ajax.request({
		url: '/wechat/workOrder/reminder',
		method: 'PUT',
		data: params
	})


}

/**
 * 工单查询
 */
export const WorkOrderSearchApi = {
	getList: (params, ) => ajax.post('/wechat/workOrderQuery/pageList', {
		data: params
	})
}

/**
 * 工单详情
 */
export const WorkOrderApi = {
	getDetail: (orderNum) => ajax.get(`/wechat/workOrderQuery/getInfoByOrderNum`, {
		data: {
			orderNum
		}
	}, ),
	// 工单超时备注
	timeoutRemark: (params) => ajax.request({
		url: '/wechat/workOrder/time/out/remark',
		method: 'PUT',
		data: params

	})
}